import VueRouter from 'vue-router'

//导入四个路由模块
import HomeContainer from  './components/tabbar/HomeContainer.vue'
import MemberContainer from  './components/tabbar/MemberContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue'
import newsList from './components/tabbar/news/newsList.vue'
import newsinfo from './components/tabbar/news/newsinfo.vue'
import photoscomponent from './components/photos/photoscomponent.vue'
import photoinfo from './components/photos/photoinfo.vue'
import goodslist from './components/goods/goodslist.vue'
import goodsinfo from './components/goods/goodsinfo.vue'
import goodsDesc from './components/goods/goodsDesc.vue'
import goodsComment from './components/goods/goodsComment.vue'

// 3. 创建路由对象
var router = new VueRouter({
  routes: [ 
    { path: '/', redirect: '/home'},
     { path: '/home', component: HomeContainer},
     { path: '/member', component: MemberContainer},
     { path: '/search', component: SearchContainer},
     { path: '/shopcar', component: ShopcarContainer},
     { path: '/home/newsList', component: newsList},
     { path: '/home/newsList/link/:id', component: newsinfo},
     { path: '/home/photos', component: photoscomponent},
     { path: '/home/photoinfo', component: photoinfo},
     { path: '/home/goodslist', component: goodslist},
     { path: '/home/goodsinfo/:id', component: goodsinfo, name: 'goodsinfo'},
     { path: '/home/goodsDesc/:id', component: goodsDesc, name: 'goodsDesc'},
     { path: '/home/goodsComment/:id', component: goodsComment, name: 'goodsComment'}
 
  ],
  linkActiveClass: 'mui-active'
})

// 把路由对象暴露出去
export default router